package com.xyz.bigcorn.admin.system.service;

import com.xyz.bigcorn.admin.common.exception.BusinessException;
import com.xyz.bigcorn.admin.common.exception.ParameterException;
import com.xyz.bigcorn.admin.system.entity.User;
import com.xyz.bigcorn.core.base.service.BaseService;
import com.xyz.bigcorn.core.result.PageResult;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @Description:
 * @author: Zhaopengfei
 * @copyright: 金鹏信息技术有限公司
 * @CreatedDate: 2018年03月14日 15:23
 * @Copyright: All rights Reserved，Designed By Jpsycn
 */
public interface UserService extends BaseService<User> {


    /**
     * 根据条件查询用户列表
     */
    List<Map<String, Object>> selectUsers( @Param("name") String name, @Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("deptid") String deptid);


    User getByUsername(String username);

    PageResult<User> list(int pageNum, int pageSize, boolean showDelete, String searchKey, String searchValue);

    User getById(String userId);

    boolean add(User user) throws BusinessException;

    boolean update(User user);
    /**
     * 修改用户状态
     */
    boolean updateState(String userId, int state) throws ParameterException;
    /**
     * 修改密码
     */
    boolean updatePsw(String userId, String username, String newPsw);

    boolean delete(String userId);


}
